<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>for...in遍历对象的属性</title>
</head>
<body>
    <div id="result"></div>
    <script>
        var books = {}; 
        var books = ["JavaScript前端开发案例教程", "Node.js核心基础教程", "HTML5移动web开发"];

var html = "<ul>";
 for (var prop in books) {
    if (books.hasOwnProperty(prop)) {
        html += "<li>" + prop + '《' + books[prop] + '》' + "</li>";
    }
}

html += "</ul>";


document.getElementById("result").innerHTML = html;
    </script>
</body>
</html>